/*统一管理项目用户相关的接口*/
import request from '@/utils/request'
import group from "@/views/system/group/index.vue";

// 获取分组分页列表
export const reqGroupPageListUrl = (queryParams) => {
  return request({
    url: '/gather/group/list',
    method: 'get',
    params: queryParams,
  })
}

// 添加分组
export const reqGroupAddUrl = (from) => {
  return request({
    url: '/gather/group/add',
    method: 'post',
    data: from,
  })
}

// 修改分组
export const reqGroupEditUrl = (from) => {
  return request({
    url: '/gather/group/edit',
    method: 'put',
    data: from,
  })
}



// 修改分组
export const reqGroupDeleteUrl = (groupIds) => {
  return request({
    url: '/gather/group/delete' + "/" + groupIds,
    method: 'delete',
  })
}

// 修改分组状态
export const reqGroupChangeStatusUrl = (from) => {
  return request({
    url: '/gather/group/changeStatus',
    method: 'put',
    data: from,
  })
}


// 获取分组成员信息
export const reqUserCroupUrl = (groupId) => {
  return request({
    url: '/authUser/allocatedList' + '/' + groupId,
    method: 'get',
  })
}


// 修改分组成员信息
export const reqEditUserCroupUrl = (data) => {
  return request({
    url: '/gather/group/editGroupUser',
    method: 'put',
    data: data,
  })
}


// 获取已经在分组中的用户
export const reqAllocatedListUrl = (groupId, param) => {
  return request({
    url: '/gather/userGroup/allocatedList/' + groupId,
    method: 'get',
    params: param,
  })
}

// 获取未在分组中的用户
export const reqUnAllocatedListUrl = (groupId, form) =>{
  return request({
    url: '/gather/userGroup/unAllocatedList' + '/' + groupId,
    method: 'get',
    params: form,
  })
}
// 添加分组用户
export const reqAddUserInGroupUrl = (groupId, data) => {
  return request({
    url: '/gather/userGroup/addUserInGroup/' + groupId,
    method: 'post',
    data: data,
  })
}
